import methods from '@/axiosrequest/http';
const { get, post, put } = methods;

//登录接口
export function login(data) {
  return post('/api/user/login', data);
}

//微信登录
export function wxLogin(data) {
  return post('/api/wx/wxlogin', data);
}

//注册接口
export function register(data) {
  return post('/api/user/register', data);
}

//检测账号是否存在
export function checkUsername(data) {
  return post('/api/user/checkAccount', {
    account: 'zhangsan'
  });
}

//用户信息接口
export function userApi(data) {
  return post('/api/user/userInfo', data);
}

//修改用户信息接口
export function updateUserInfoApi(data) {
  return post('/api/user/updateUserInfo', data);
}

//分享圈接口
export function shareApi(data) {
  return post('/api/share/pageShare', data);
}

//分享圈点赞接口
export function shareThumbsUp(data) {
  return post('/api/fabulous/insert', {
    shareId: 1,
    userId: '1'
  });
}

//分享圈详情接口
export function shareDetail(data) {
  return post('/api/share/detail', data);
}

//增加评论接口
export function addComment(data) {
  return post('/api/comment/insert', {
    userId: 1,
    shareId: 1,
    content: '我是一条评论'
  });
}

//我的评论接口
export function myComments(data) {
  return post('/api/comment/myComment', data);
}

//商户浏览数查询
export function shopScanNum(data) {
  return post('/bur/getBussinesUserRelationInfo', data);
}

//商户端浏览数增加接口
export function shopScanNumAdd() {
  return post('/bur/insert', {});
}

//折扣信息查询
export function getDiscountGoods(data) {
  return post('/api/discount/getDiscountInfo', data);
}

//折扣信息添加接口
export function discountGoodsAdd(data) {
  return post('/api/discount/insert', data);
}

//折扣信息更新接口
export function discountGoodsUpdate(data) {
  return put('/api/discount/update', data);
}

//折扣转化率接口
export function discountTransformPercent(data) {
  return post('/api/discount/getDiscountChance', data);
}

//我的商户信息
export function myShopInfo(data) {
  return post('/api/bussines/getBussinesByUserId', data);
}

//查询分享转化率接口
export function shareTransformPercent() {
  return post('/api/share/getBussinesShareChance', {
    entityId: 1, //对象id
    entityType: 'bussines' //对象类型
  });
}

//分享圈添加接口
export function shareAdd() {
  return post('/api/share/insert', {
    entityId: 1, //分享对象id
    entityType: 'bussines', //分享对象
    userId: 1, //用户id
    content: '222', //分享内容
    images: '12' //图片链接
  });
}

//分享圈更新接口
export function shareUpdate() {
  return put('/api/share/update', {
    id: 1, //分享圈id
    entityId: 1, //分享对象id
    entityType: 'bussines', //分享对象
    userId: 1, //用户id
    content: '222', //分享内容
    images: '12' //图片链接
  });
}

//提交分享达人审核接口
export function sharePeopleVerify() {
  return post('/api/usersupershare/createUserSuperShare', {
    userId: 1
  });
}

//银行卡列表接口
export function userBankCardList(data) {
  return post('/api/userbank/list', {
    userId: 1
  });
}

//绑定银行卡接口
export function bindBankCard(data) {
  return post('/api/userbank/insert', data);
}

//用户银行卡详情接口
export function userBankCardDetail(data) {
  return post('/api/userbank/detail', {
    bindId: '1'
  });
}

//用户解绑银行卡接口
export function unBindUserBankCard(data) {
  return post('/api/userbank/relieve', {
    bindId: '1'
  });
}

//用户提现接口
export function cash(data) {
  return post('/api/cash/insert', {
    bindId: '1',
    amount: 1,
    userId: 1
  });
}

//用户提现记录接口
export function cashList(data) {
  return post('/api/cash/list', {
    pageNum: 1,
    pageSize: 10,
    request: {
      userId: 1
    }
  });
}

//银行列表接口
export function bankList(data) {
  return post('/api/bank/page', {
    pageNum: 1,
    pageSize: 10,
    request: {
      // code: "1026",
      // enCode: "BOC",
      // name: "中国银行",
      // shortName: "中国银行"
    }
  });
}

//添加商品接口
export function addGoods(data) {
  // "dishes": {
  //   "dishesName": "",
  //   "dishesImage": "",
  //   "dishesPrice": 1,
  //   "discount": 1,
  //   " bussinesId": 1
  // }
  return post('/api/dishes/insertDish', data);
}

//修改商品信息接口
export function updateGoods(data) {
  // "dishes": {
  //   "dishesName": "",
  //   "dishesImage": "",
  //   "dishesPrice": 1,
  //   "discount": 1,
  //   " bussinesId": 1
  // }
  return post('/api/dishes/updateDish', data);
}

//商品下架接口
export function deleteGoods(data) {
  // "dishes": {
  //   "dishesId": "",
  //   " bussinesId": ""
  // }
  return post('/api/dishes/deleteDish', data);
}

//查询商家所有商品接口
export function getBusinessGoods(data) {
  // "pageNum": 1,
  // "pageSize": 1,
  // "request": {
  //   "bussinesId": 1
  // }
  return post('/api/dishes/getDishes', data);
}

//成为商家接口
export function applyForBoss(data) {
  return post('/api/bussines/createBussines', data);
}

//查询所有标签接口
export function getTags() {
  return post('/api/label/getBussinesLabel');
}
